import {createRouter, createWebHashHistory} from 'vue-router';
import Home from "~/pages/index.vue"


const routes = [
    {
        path: '/',
        redirect: '/home',
    },
    {
        path: '/home',
        component: Home,
        redirect: '/fristPage',
        children: [
            {
                path: '/fristPage',
                component: () => import(/* webpackChunkName:"other" */'~/pages/fristPage/index.vue'),
                redirect: '/pagesFrist',
                children: [
                    {
                        path: '/pagesFrist',
                        component: () => import(/* webpackChunkName:"other" */'~/pages/fristPage/pagesFrist/index.vue'),
                        meta: {
                            keepAlive: true,
                            title: '个性推荐',
                            name: '个性推荐'
                        }

                    },
                    {
                        path: '/songList',
                        component: () => import(/* webpackChunkName:"other" */'~/pages/fristPage/songList/index.vue'),
                        meta: {
                            requireAuth: true,
                            keepAlive: true,
                            title: '歌单',
                            name: '歌单'
                        }
                    },
                    {
                        path: '/leaderboard',
                        component: () => import(/* webpackChunkName:"other" */'~/pages/fristPage/leaderboard/index.vue'),
                        meta: {
                            requireAuth: true,
                            keepAlive: true,
                            title: '排行榜',
                            name: '排行榜'
                        }
                    },
                    {
                        path: '/singer',
                        component: () => import(/* webpackChunkName:"other" */'~/pages/fristPage/singer/index.vue'),
                        meta: {
                            requireAuth: true,
                            keepAlive: true,
                            title: '歌手',
                            name: '歌手'
                        }
                    },


                ]
            },
            {
                path: '/login',
                name: 'login',
                component: () => import(/* webpackChunkName:"other" */'~/pages/login/index.vue')
            },
            {
                path: '/user',
                component: () => import(/* webpackChunkName:"other" */'~/pages/user/index.vue'),
                meta: {
                    requireAuth: true,
                    keepAlive: true,
                    title: '个人中心'
                }
            },
            {
                path: '/video',
                component: () => import(/* webpackChunkName:"other" */'~/pages/video/videoList/index.vue'),
                // redirect: '/videoList',
                meta: {
                    requireAuth: true,
                    // keepAlive: false,
                    title: '视频',
                }
                // children:[
                //     {
                //         path: '/videoList',
                //         name:'videoList',
                //         component: () => import(/* webpackChunkName:"other" */'~/pages/video/videoList/index.vue'),
                //         meta: {
                //             requireAuth: true,
                //             // keepAlive: false,
                //             title: '视频',
                //         }
                //     },
                // ]
            },
            {
                path: '/collect',
                component: () => import(/* webpackChunkName:"other" */'~/pages/collect/index.vue'),
                meta: {
                    requireAuth: true,
                    keepAlive: true,
                    title: '收藏'
                }
            },
            {
                path: '/recommend',
                component: () => import(/* webpackChunkName:"other" */'~/pages/recommend/index.vue'),
                meta: {
                    requireAuth: true,
                    keepAlive: true,
                    title: '每日推荐'
                }
            },
            {
                path: '/detail',
                component: () => import(/* webpackChunkName:"other" */'~/pages/detail/index.vue'),
                meta: {
                    requireAuth: true,
                    keepAlive: false,
                    title: '歌单'
                }
            },
            {
                path: '/singerDetails',
                component: () => import(/* webpackChunkName:"other" */'~/pages/singerDetails/index.vue'),
                meta: {
                    requireAuth: true,
                    keepAlive: false,
                    title: '歌手详情'
                }
            },
            {
                path: '/album',
                component: () => import(/* webpackChunkName:"other" */'~/pages/album/index.vue'),
                meta: {
                    requireAuth: true,
                    keepAlive: false,
                    title: '专辑详情'
                }
            },
            {
                path: '/seach',
                component: () => import(/* webpackChunkName:"other" */'~/pages/seach/index.vue'),
                meta: {
                    requireAuth: true,
                    keepAlive: false,
                    title: '专辑详情'
                }
            },
            {
                path: '/mvList',
                name: 'mvList',
                component: () => import(/* webpackChunkName:"other" */'~/pages/mvList/index.vue'),
                meta: {
                    requireAuth: true,
                    keepAlive: false,
                    title: '视频播放',
                }
            },
            {
                path: '/polytechnic',
                component: () => import(/* webpackChunkName:"other" */'~/pages/mvList/polytechnic.vue'),
            },

        ]
    },


];

export const router = createRouter({
    // 4. 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
    history: createWebHashHistory(),
    routes, // `routes: routes` 的缩写
})

